import request from '@/utils/request'
import apilist from './apibackstage'
import ENV from '@/imageFactory/ENV'
import axios from 'axios'


const addqiye = function(data) {  //企业注册
  return request({
    url: apilist.APILIST.addenterprises,
    method: 'post',
    data:data
  })
};
const enterpriselogin = function(data) {  //管理后台登陆
  return request({
    url: apilist.APILIST.login,
    method: 'post',
    data:data
  })
};
const showenterprisesfn =function(data,e) {  //总后台企业管理列表
  return request({
    url: apilist.APILIST.showenterprises+'?page='+e,
    method: 'post',
    data:data
  })
};
const freezing = function(data) {  //冻结企业
  return request({
    url: apilist.APILIST.frozenenterprises,
    method: 'post',
    data:data
  })
};
const searchprises = function(data) {  //搜索企业
  return request({
    url: apilist.APILIST.searchenterprises,
    method: 'post',
    data:data
  })
};
const editenterprises = function(data) { //编辑企业
  return request({
    url: apilist.APILIST.editenterprises,
    method: 'post',
    data:data
  })
};

const adminresetpassword = function(data) { //重置企业密码
  return request({
    url: apilist.APILIST.adminresetpassword,
    method: 'post',
    data:data
  })
};
const SetTemp = function(data) { //创建模板
  return request({
    url: apilist.APILIST.settemp,
    method: 'post',
    data:data
  })
};
const SeeenterPrisesgoods = function(data) { //查看企业商品
  return request({
    url: apilist.APILIST.seeenterprisesgoods,
    method: 'post',
    data:data
  })
};
const FrozenenterPrisesgoods = function(data) { //冻结企业商品
  return request({
    url: apilist.APILIST.frozenenterprisesgoods,
    method: 'post',
    data:data
  })
};
const DeleteenterPrisesgoods = function(data) { //删除企业商品
  return request({
    url: apilist.APILIST.deleteenterprisesgoods,
    method: 'post',
    data:data
  })
};
const UpdatePassword = function(data) { //删除企业商品
  return request({
    url: apilist.APILIST.updatepassword,
    method: 'post',
    data:data
  })
};
const CountenterPrises = function(data) { //删除企业商品
  return request({
    url: apilist.APILIST.countenterprises,
    method: 'post',
    data:data
  })
};

//企业管理
const ResetPassword = function(data) { //重置企业密码
  return request({
    url: apilist.APILIST.resetpassword,
    method: 'post',
    data:data
  })
};

const AddGoods = function(data) { //企业添加产品
  return request({
    url: apilist.APILIST.addgoods,
    method: 'post',
    data:data
  })
};
const EdithGoods = function(data) { //编辑企业产品
  return request({
    url: apilist.APILIST.edithoods,
    method: 'post',
    data:data
  })
};

const ShowGoods = function(data,e) { //产品列表
  return request({
    url: apilist.APILIST.showgoods+'?page='+e,
    method: 'post',
    data:data
  })
};

const FrozenGoods = function(data) { //冻结产品
  return request({
    url: apilist.APILIST.frozengoods,
    method: 'post',
    data:data
  })
};

const SearchGoods = function(data) { //搜索产品
  return request({
    url: apilist.APILIST.searchgoods,
    method: 'post',
    data:data
  })
};

const DeleteGoods = function(data) { //删除产品
  return request({
    url: apilist.APILIST.deletegoods,
    method: 'post',
    data:data
  })
};

const AddNatches = function(data,e) { //添加批次
  return request({
    url: apilist.APILIST.addnatches,
    method: 'post',
    data:data
  })
};
const ShowBatches = function(data,e) { //批次列表
  return request({
    url: apilist.APILIST.showbatches+'?page='+e,
    method: 'post',
    data:data
  })
};
//
const PidShowBatches = function(data,e) { // PID 批次列表
  return request({
    url: apilist.APILIST.pidshowbatches+'?page='+e,
    method: 'post',
    data:data
  })
};
//
const DeleteBatches = function(data) { //删除批次
  return request({
    url: apilist.APILIST.deletebatches,
    method:'post',
    data:data
  })
};

const SearchBatches = function(data) { //搜索批次
  return request({
    url: apilist.APILIST.searchbatches,
    method:'post',
    data:data
  })
};
const GetTemp = function(data) { //搜索批次
  return request({
    url: apilist.APILIST.gettemp,
    method:'post',
    data:data
  })
};
const EditBatches = function(data) { //编辑批次
  return request({
    url: apilist.APILIST.editbatches,
    method:'post',
    data:data
  })
};
const AddoutBounds = function(data) { //新增出库单
  return request({
    url: apilist.APILIST.addoutbounds,
    method:'post',
    data:data
  })
};
const ShowoutBounds = function(data) { //新增出库单
  return request({
    url: apilist.APILIST.showoutbounds,
    method:'post',
    data:data
  })
};
const EditoutBounds = function(data) { //修改出库单
  return request({
    url: apilist.APILIST.editoutbounds,
    method:'post',
    data:data
  })
};
const DeleteoutBounds = function(data) { //删除出库单
  return request({
    url: apilist.APILIST.deleteoutbounds,
    method:'post',
    data:data
  })
};
const SearchoutBounds = function(data) { //删除出库单
  return request({
    url: apilist.APILIST.searchoutbounds,
    method:'post',
    data:data
  })
};
const EditPassword = function(data) { //修改密码
  return request({
    url: apilist.APILIST.editpassword,
    method:'post',
    data:data
  })
};

// this.$apifn.CountenterPrises().then((ref)=>{
//     if(ref.data.Response.code == 200){
// }
// }).catch((res)=>{
// });
export default {
  CountenterPrises, //统计企业数量
  addqiye,          //企业注册
  enterpriselogin,  //管理后台登陆
  showenterprisesfn,//总后台企业管理列表
  freezing,         //冻结企业
  searchprises,     //搜索企业
  editenterprises,  //编辑企业
  adminresetpassword,//重置企业密码
  SetTemp,//创建模板
  SeeenterPrisesgoods,//查看企业商品
  FrozenenterPrisesgoods,//冻结企业商品
  DeleteenterPrisesgoods,//删除企业商品
  UpdatePassword,        //超级管理源
  //企业管理
  ResetPassword,   //重置企业密码
  AddGoods,        //添加产品
  EdithGoods,     //编辑企业产品
  ShowGoods,      //产品列表
  FrozenGoods,    //冻结产品
  SearchGoods,    //搜索产品
  DeleteGoods,    //删除产品
  AddNatches,     //添加批次
  ShowBatches,    //批次列表
  PidShowBatches, //Pid 批次列表
  DeleteBatches,  //删除批次
  SearchBatches,  //搜索批次
  GetTemp,        //获取模板
  EditBatches,    //编辑批次
  AddoutBounds,   //出库单
  ShowoutBounds,  //显示出库单
  EditoutBounds,  //修改出库单
  DeleteoutBounds,//删除出库单
  SearchoutBounds,//搜索出库单
  EditPassword,   //修改密码
}

